<template>
  <div>
    <!-- <h3>子组件{{ value }}</h3> -->
    <h3>这是a的值{{ a }}</h3>
    <h3>这是b的值{{ b }}</h3>
    <button @click="hclick">点击</button>
  </div>
</template>

<script>
export default {
  props: {
    // value: {
    //   type: Number,
    //   required: true
    // },
    a: {
      type: Number,
      required: true
    },
    b: {
      type: Number,
      required: true
    }
  },
  data() {
    return {
      n: 100,
      n1: 200,
      n2: 300
    }
  },
  methods: {
    hclick() {
      this.$emit('input', ++this.n)
      this.$emit('update:a', ++this.n1)
      this.$emit('update:b', ++this.n2)
    }
  }
}
</script>

<style>

</style>
